<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>8 模板语法-指令</title>
    <script src="js/vue.global.js"></script>
    <style>
        .classA {
            color: red;
            font-size:30px;
        }
    </style>
</head>
<body>
<div id="app">
    <runoob class="classA"></runoob>
</div>

<script>
    const app = Vue.createApp({})

    app.component('runoob', {
        template: `
    <p :class="$attrs.class">I like runoob!</p>
    <span>这是一个子组件</span>
  `
    })

    app.mount('#app')
</script>
</body>
</html>